package com.example.auth3.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
 * 登录失败处理器
 * @author shangSshang
 * 2018.12.21 12:00:03
 */
@Configuration
public class LoginFailHandler implements AuthenticationFailureHandler {
    private   static final  Logger logger = LoggerFactory.getLogger(LoginFailHandler.class);
    @Override
    public void onAuthenticationFailure(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AuthenticationException e) throws IOException, ServletException {
        logger.info("失败");
    }
}